﻿using System;
using System.ComponentModel;
using System.Windows;
using System.Collections.Generic;
using Kaesoft.Hospedaje.Entities;

namespace Kaesoft.Hospedaje.Proxy.AdministracionReference
{
    public partial class ServicioAdministracionClient
    {

        public void ValidarCredencialesAsync(string login, string pass, Action<ValidarCredencialesCompletedEventArgs> method)
        {
            if ((this.onBeginValidarCredencialesDelegate == null))
            {
                this.onBeginValidarCredencialesDelegate = new BeginOperationDelegate(this.OnBeginValidarCredenciales);
            }
            if ((this.onEndValidarCredencialesDelegate == null))
            {
                this.onEndValidarCredencialesDelegate = new EndOperationDelegate(this.OnEndValidarCredenciales);
            }

            System.Threading.SendOrPostCallback customValidarCredencialesDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ValidarCredencialesCompletedEventArgs eventArg = new ValidarCredencialesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error != null ? new AuthenticationException("Credenciales no válidas") : null))
                    {
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                    }

                }
            }
            );


            base.InvokeAsync(this.onBeginValidarCredencialesDelegate, new object[] {
						login,
						pass}, this.onEndValidarCredencialesDelegate, customValidarCredencialesDelegate, null);
        }

        public void GuardarPerfilOpcionAsync(string perfilNombre, Guid perfilId, List<PerfilOpcion> poAgregar, Action<GuardarPerfilOpcionCompletedEventArgs> method)
        {
            if ((this.onBeginGuardarPerfilOpcionDelegate == null))
            {
                this.onBeginGuardarPerfilOpcionDelegate = new BeginOperationDelegate(this.OnBeginGuardarPerfilOpcion);
            }
            if ((this.onEndGuardarPerfilOpcionDelegate == null))
            {
                this.onEndGuardarPerfilOpcionDelegate = new EndOperationDelegate(this.OnEndGuardarPerfilOpcion);
            }


            System.Threading.SendOrPostCallback customGuardarPerfilOpcionDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    GuardarPerfilOpcionCompletedEventArgs eventArg = new GuardarPerfilOpcionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginGuardarPerfilOpcionDelegate, new object[] {
						perfilNombre, perfilId, poAgregar}, this.onEndGuardarPerfilOpcionDelegate, customGuardarPerfilOpcionDelegate, null);
        }

        public void ObtenerPerfilesAsync(Action<ObtenerPerfilesCompletedEventArgs> method)
        {
            if ((this.onBeginObtenerPerfilesDelegate == null))
            {
                this.onBeginObtenerPerfilesDelegate = new BeginOperationDelegate(this.OnBeginObtenerPerfiles);
            }
            if ((this.onEndObtenerPerfilesDelegate == null))
            {
                this.onEndObtenerPerfilesDelegate = new EndOperationDelegate(this.OnEndObtenerPerfiles);
            }

            System.Threading.SendOrPostCallback customObtenerPerfilesDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ObtenerPerfilesCompletedEventArgs eventArg = new ObtenerPerfilesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );

            base.InvokeAsync(this.onBeginObtenerPerfilesDelegate, null, this.onEndObtenerPerfilesDelegate, customObtenerPerfilesDelegate, null);
        }

        public void ObtenerUsuariosPorCriteriosAsync(Action<ObtenerUsuariosPorCriteriosCompletedEventArgs> method)
        {
            if ((this.onBeginObtenerPerfilesDelegate == null))
            {
                this.onBeginObtenerPerfilesDelegate = new BeginOperationDelegate(this.OnBeginObtenerPerfiles);
            }
            if ((this.onEndObtenerPerfilesDelegate == null))
            {
                this.onEndObtenerPerfilesDelegate = new EndOperationDelegate(this.OnEndObtenerPerfiles);
            }

            System.Threading.SendOrPostCallback customObtenerPerfilesDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ObtenerPerfilesCompletedEventArgs eventArg = new ObtenerPerfilesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );

            base.InvokeAsync(this.onBeginObtenerPerfilesDelegate, null, this.onEndObtenerPerfilesDelegate, customObtenerPerfilesDelegate, null);
        }

        public void ObtenerUsuariosPorCriteriosAsync(int tipoConsulta, string criterio, int indice, Action<ObtenerUsuariosPorCriteriosCompletedEventArgs> method)
        {
            if ((this.onBeginObtenerUsuariosPorCriteriosDelegate == null))
            {
                this.onBeginObtenerUsuariosPorCriteriosDelegate = new BeginOperationDelegate(this.OnBeginObtenerUsuariosPorCriterios);
            }
            if ((this.onEndObtenerUsuariosPorCriteriosDelegate == null))
            {
                this.onEndObtenerUsuariosPorCriteriosDelegate = new EndOperationDelegate(this.OnEndObtenerUsuariosPorCriterios);
            }

            System.Threading.SendOrPostCallback customObtenerUsuariosPorCriteriosDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ObtenerUsuariosPorCriteriosCompletedEventArgs eventArg = new ObtenerUsuariosPorCriteriosCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );

            base.InvokeAsync(this.onBeginObtenerUsuariosPorCriteriosDelegate, new object[] {
						tipoConsulta,
						criterio,
						indice}, this.onEndObtenerUsuariosPorCriteriosDelegate, customObtenerUsuariosPorCriteriosDelegate, null);
        }

        public void GrabarUsuariosAsync(System.Collections.Generic.List<Kaesoft.Hospedaje.Entities.Usuario> usuarios, Action<AsyncCompletedEventArgs> method)
        {
            if ((this.onBeginGrabarUsuariosDelegate == null))
            {
                this.onBeginGrabarUsuariosDelegate = new BeginOperationDelegate(this.OnBeginGrabarUsuarios);
            }
            if ((this.onEndGrabarUsuariosDelegate == null))
            {
                this.onEndGrabarUsuariosDelegate = new EndOperationDelegate(this.OnEndGrabarUsuarios);
            }


            System.Threading.SendOrPostCallback customGrabarUsuariosDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    AsyncCompletedEventArgs eventArg = new AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );


            base.InvokeAsync(this.onBeginGrabarUsuariosDelegate, new object[] {
						usuarios}, this.onEndGrabarUsuariosDelegate, customGrabarUsuariosDelegate, null);
        }

        public void ListarArbolPerfilesAsync(Action<ListarArbolPerfilesCompletedEventArgs> method)
        {
            if ((this.onBeginListarArbolPerfilesDelegate == null))
            {
                this.onBeginListarArbolPerfilesDelegate = new BeginOperationDelegate(this.OnBeginListarArbolPerfiles);
            }
            if ((this.onEndListarArbolPerfilesDelegate == null))
            {
                this.onEndListarArbolPerfilesDelegate = new EndOperationDelegate(this.OnEndListarArbolPerfiles);
            }


            System.Threading.SendOrPostCallback customListarArbolPerfilesDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ListarArbolPerfilesCompletedEventArgs eventArg = new ListarArbolPerfilesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginListarArbolPerfilesDelegate, null, this.onEndListarArbolPerfilesDelegate, customListarArbolPerfilesDelegate, null);
        }

        public void ListarArbolOpcionesAsync(Action<ListarArbolOpcionesCompletedEventArgs> method)
        {
            if ((this.onBeginListarArbolOpcionesDelegate == null))
            {
                this.onBeginListarArbolOpcionesDelegate = new BeginOperationDelegate(this.OnBeginListarArbolOpciones);
            }
            if ((this.onEndListarArbolOpcionesDelegate == null))
            {
                this.onEndListarArbolOpcionesDelegate = new EndOperationDelegate(this.OnEndListarArbolOpciones);
            }


            System.Threading.SendOrPostCallback customListarArbolOpcionesDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ListarArbolOpcionesCompletedEventArgs eventArg = new ListarArbolOpcionesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginListarArbolOpcionesDelegate, null, this.onEndListarArbolOpcionesDelegate, customListarArbolOpcionesDelegate, null);
        }

        public void ListarArbolOpcionesPorIdAsync(Guid idOpcion, Action<ListarArbolOpcionesPorIdCompletedEventArgs> method)
        {
            if ((this.onBeginListarArbolOpcionesPorIdDelegate == null))
            {
                this.onBeginListarArbolOpcionesPorIdDelegate = new BeginOperationDelegate(this.OnBeginListarArbolOpcionesPorId);
            }
            if ((this.onEndListarArbolOpcionesPorIdDelegate == null))
            {
                this.onEndListarArbolOpcionesPorIdDelegate = new EndOperationDelegate(this.OnEndListarArbolOpcionesPorId);
            }


            System.Threading.SendOrPostCallback customListarArbolOpcionesPorIdDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ListarArbolOpcionesPorIdCompletedEventArgs eventArg = new ListarArbolOpcionesPorIdCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginListarArbolOpcionesPorIdDelegate, new object[] {
						idOpcion}, this.onEndListarArbolOpcionesPorIdDelegate, customListarArbolOpcionesPorIdDelegate, null);
        }

        public void ListarOperacionesAsync(Action<ListarOperacionesCompletedEventArgs> method)
        {
            if ((this.onBeginListarOperacionesDelegate == null))
            {
                this.onBeginListarOperacionesDelegate = new BeginOperationDelegate(this.OnBeginListarOperaciones);
            }
            if ((this.onEndListarOperacionesDelegate == null))
            {
                this.onEndListarOperacionesDelegate = new EndOperationDelegate(this.OnEndListarOperaciones);
            }


            System.Threading.SendOrPostCallback customListarOperacionesDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ListarOperacionesCompletedEventArgs eventArg = new ListarOperacionesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginListarOperacionesDelegate, null, this.onEndListarOperacionesDelegate, customListarOperacionesDelegate, null);
        }

        public void ObtenerPerfilPorIdAsync(Guid idPerfil, Action<ObtenerPerfilPorIdCompletedEventArgs> method)
        {
            if ((this.onBeginObtenerPerfilPorIdDelegate == null))
            {
                this.onBeginObtenerPerfilPorIdDelegate = new BeginOperationDelegate(this.OnBeginObtenerPerfilPorId);
            }
            if ((this.onEndObtenerPerfilPorIdDelegate == null))
            {
                this.onEndObtenerPerfilPorIdDelegate = new EndOperationDelegate(this.OnEndObtenerPerfilPorId);
            }


            System.Threading.SendOrPostCallback customObtenerPerfilPorIdDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ObtenerPerfilPorIdCompletedEventArgs eventArg = new ObtenerPerfilPorIdCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginObtenerPerfilPorIdDelegate, new object[] {
						idPerfil}, this.onEndObtenerPerfilPorIdDelegate, customObtenerPerfilPorIdDelegate, null);
        }

        public void ObtenerOperacionPorPerfilYOpcionAsync(Guid idPerfil, Guid idOpcion, Action<ObtenerOperacionPorPerfilYOpcionCompletedEventArgs> method)
        {
            if ((this.onBeginObtenerOperacionPorPerfilYOpcionDelegate == null))
            {
                this.onBeginObtenerOperacionPorPerfilYOpcionDelegate = new BeginOperationDelegate(this.OnBeginObtenerOperacionPorPerfilYOpcion);
            }
            if ((this.onEndObtenerOperacionPorPerfilYOpcionDelegate == null))
            {
                this.onEndObtenerOperacionPorPerfilYOpcionDelegate = new EndOperationDelegate(this.OnEndObtenerOperacionPorPerfilYOpcion);
            }


            System.Threading.SendOrPostCallback customObtenerOperacionPorPerfilYOpcionDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ObtenerOperacionPorPerfilYOpcionCompletedEventArgs eventArg = new ObtenerOperacionPorPerfilYOpcionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginObtenerOperacionPorPerfilYOpcionDelegate, new object[] {
						idPerfil, idOpcion}, this.onEndObtenerOperacionPorPerfilYOpcionDelegate, customObtenerOperacionPorPerfilYOpcionDelegate, null);
        }

        public void InsertarNuevoPerfilAsync(Perfil nuevoPerfil, Action<InsertarNuevoPerfilCompletedEventArgs> method)
        {
            if ((this.onBeginInsertarNuevoPerfilDelegate == null))
            {
                this.onBeginInsertarNuevoPerfilDelegate = new BeginOperationDelegate(this.OnBeginInsertarNuevoPerfil);
            }
            if ((this.onEndInsertarNuevoPerfilDelegate == null))
            {
                this.onEndInsertarNuevoPerfilDelegate = new EndOperationDelegate(this.OnEndInsertarNuevoPerfil);
            }


            System.Threading.SendOrPostCallback customInsertarNuevoPerfilDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    InsertarNuevoPerfilCompletedEventArgs eventArg = new InsertarNuevoPerfilCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginInsertarNuevoPerfilDelegate, new object[] {
						nuevoPerfil}, this.onEndInsertarNuevoPerfilDelegate, customInsertarNuevoPerfilDelegate, null);
        }

        public void ActualizaPerfilAsync(string perfilNombre, Guid perfilId, List<PerfilOpcion> poEliminar, List<PerfilOpcion> poAgregar, List<PerfilOpcionOperacion> pooEliminar, List<PerfilOpcionOperacion> pooAgregar, Action<ActualizaPerfilCompletedEventArgs> method)
        {
            if ((this.onBeginActualizaPerfilDelegate == null))
            {
                this.onBeginActualizaPerfilDelegate = new BeginOperationDelegate(this.OnBeginActualizaPerfil);
            }
            if ((this.onEndActualizaPerfilDelegate == null))
            {
                this.onEndActualizaPerfilDelegate = new EndOperationDelegate(this.OnEndActualizaPerfil);
            }


            System.Threading.SendOrPostCallback customActualizaPerfilDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ActualizaPerfilCompletedEventArgs eventArg = new ActualizaPerfilCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginActualizaPerfilDelegate, new object[] {
						perfilNombre, perfilId, poEliminar, poAgregar, pooEliminar, pooAgregar}, this.onEndActualizaPerfilDelegate, customActualizaPerfilDelegate, null);
        }

        public void EliminaPerfilesAsync(List<Perfil> perfiles, Action<EliminaPerfilesCompletedEventArgs> method)
        {
            if ((this.onBeginEliminaPerfilesDelegate == null))
            {
                this.onBeginEliminaPerfilesDelegate = new BeginOperationDelegate(this.OnBeginEliminaPerfiles);
            }
            if ((this.onEndEliminaPerfilesDelegate == null))
            {
                this.onEndEliminaPerfilesDelegate = new EndOperationDelegate(this.OnEndEliminaPerfiles);
            }


            System.Threading.SendOrPostCallback customEliminaPerfilesDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    EliminaPerfilesCompletedEventArgs eventArg = new EliminaPerfilesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginEliminaPerfilesDelegate, new object[] {
						perfiles}, this.onEndEliminaPerfilesDelegate, customEliminaPerfilesDelegate, null);
        }

        public void ObtenerPerfilPorNombreAsync(string nombrePerfil, Action<ObtenerPerfilPorNombreCompletedEventArgs> method)
        {
            if ((this.onBeginObtenerPerfilPorNombreDelegate == null))
            {
                this.onBeginObtenerPerfilPorNombreDelegate = new BeginOperationDelegate(this.OnBeginObtenerPerfilPorNombre);
            }
            if ((this.onEndObtenerPerfilPorNombreDelegate == null))
            {
                this.onEndObtenerPerfilPorNombreDelegate = new EndOperationDelegate(this.OnEndObtenerPerfilPorNombre);
            }


            System.Threading.SendOrPostCallback customObtenerPerfilPorNombreDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ObtenerPerfilPorNombreCompletedEventArgs eventArg = new ObtenerPerfilPorNombreCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginObtenerPerfilPorNombreDelegate, new object[] {
						nombrePerfil}, this.onEndObtenerPerfilPorNombreDelegate, customObtenerPerfilPorNombreDelegate, null);
        }

        public void RestaurarClaveAsync(Guid idUsuarioResetear, Action<AsyncCompletedEventArgs> method)
        {
            if ((this.onBeginRestaurarClaveDelegate == null))
            {
                this.onBeginRestaurarClaveDelegate = new BeginOperationDelegate(this.OnBeginRestaurarClave);
            }
            if ((this.onEndRestaurarClaveDelegate == null))
            {
                this.onEndRestaurarClaveDelegate = new EndOperationDelegate(this.OnEndRestaurarClave);
            }


            System.Threading.SendOrPostCallback customRestaurarClaveDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    AsyncCompletedEventArgs eventArg = new AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginRestaurarClaveDelegate, new object[] {
						idUsuarioResetear}, this.onEndRestaurarClaveDelegate, customRestaurarClaveDelegate, null);
        }

        public void ValidaUsuarioAsync(Usuario usuarioValidar, Action<ValidaUsuarioCompletedEventArgs> method)
        {
            if ((this.onBeginValidaUsuarioDelegate == null))
            {
                this.onBeginValidaUsuarioDelegate = new BeginOperationDelegate(this.OnBeginValidaUsuario);
            }
            if ((this.onEndValidaUsuarioDelegate == null))
            {
                this.onEndValidaUsuarioDelegate = new EndOperationDelegate(this.OnEndValidaUsuario);
            }


            System.Threading.SendOrPostCallback customValidaUsuarioDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ValidaUsuarioCompletedEventArgs eventArg = new ValidaUsuarioCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginValidaUsuarioDelegate, new object[] {
						usuarioValidar}, this.onEndValidaUsuarioDelegate, customValidaUsuarioDelegate, null);
        }

        public void ObtenerDatosOpcionOperacionAsync(Guid idPerfil, Guid idOpcion, Action<ObtenerDatosOpcionOperacionCompletedEventArgs> method)
        {
            if ((this.onBeginObtenerDatosOpcionOperacionDelegate == null))
            {
                this.onBeginObtenerDatosOpcionOperacionDelegate = new BeginOperationDelegate(this.OnBeginObtenerDatosOpcionOperacion);
            }
            if ((this.onEndObtenerDatosOpcionOperacionDelegate == null))
            {
                this.onEndObtenerDatosOpcionOperacionDelegate = new EndOperationDelegate(this.OnEndObtenerDatosOpcionOperacion);
            }


            System.Threading.SendOrPostCallback customObtenerDatosOpcionOperacionDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ObtenerDatosOpcionOperacionCompletedEventArgs eventArg = new ObtenerDatosOpcionOperacionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginObtenerDatosOpcionOperacionDelegate, new object[] {
						idPerfil, idOpcion}, this.onEndObtenerDatosOpcionOperacionDelegate, customObtenerDatosOpcionOperacionDelegate, null);
        }

        public void GuardaOperacionAsync(PerfilOpcion PropiedadPerfilOpcion, Action<AsyncCompletedEventArgs> method)
        {
            if ((this.onBeginGuardaOperacionDelegate == null))
            {
                this.onBeginGuardaOperacionDelegate = new BeginOperationDelegate(this.OnBeginGuardaOperacion);
            }
            if ((this.onEndGuardaOperacionDelegate == null))
            {
                this.onEndGuardaOperacionDelegate = new EndOperationDelegate(this.OnEndGuardaOperacion);
            }


            System.Threading.SendOrPostCallback customGuardaOperacionDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    AsyncCompletedEventArgs eventArg = new AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );


            base.InvokeAsync(this.onBeginGuardaOperacionDelegate, new object[] {
						PropiedadPerfilOpcion}, this.onEndGuardaOperacionDelegate, customGuardaOperacionDelegate, null);
        }

        public void ObtenerPerfilOpcionAsync(Guid idPerfil, Guid idOpcion, Action<ObtenerPerfilOpcionCompletedEventArgs> method)
        {
            if ((this.onBeginObtenerPerfilOpcionDelegate == null))
            {
                this.onBeginObtenerPerfilOpcionDelegate = new BeginOperationDelegate(this.OnBeginObtenerPerfilOpcion);
            }
            if ((this.onEndObtenerPerfilOpcionDelegate == null))
            {
                this.onEndObtenerPerfilOpcionDelegate = new EndOperationDelegate(this.OnEndObtenerPerfilOpcion);
            }


            System.Threading.SendOrPostCallback customObtenerPerfilOpcionDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ObtenerPerfilOpcionCompletedEventArgs eventArg = new ObtenerPerfilOpcionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginObtenerPerfilOpcionDelegate, new object[] {
						idPerfil, idOpcion}, this.onEndObtenerPerfilOpcionDelegate, customObtenerPerfilOpcionDelegate, null);
        }

        public void ActualizaPerfilFAsync(string perfilNombre, Guid perfilId, Action<ActualizaPerfilFCompletedEventArgs> method)
        {
            if ((this.onBeginActualizaPerfilFDelegate == null))
            {
                this.onBeginActualizaPerfilFDelegate = new BeginOperationDelegate(this.OnBeginActualizaPerfilF);
            }
            if ((this.onEndActualizaPerfilFDelegate == null))
            {
                this.onEndActualizaPerfilFDelegate = new EndOperationDelegate(this.OnEndActualizaPerfilF);
            }


            System.Threading.SendOrPostCallback customActualizaPerfilFDelegate = new System.Threading.SendOrPostCallback(
            state =>
            {
                if (method != null)
                {
                    InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                    ActualizaPerfilFCompletedEventArgs eventArg = new ActualizaPerfilFCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState);
                    if (!WcfProxyInvoker.ExistenErroresAsync(eventArg.Error))
                        Deployment.Current.Dispatcher.BeginInvoke(method, eventArg);
                }
            }
            );
            base.InvokeAsync(this.onBeginActualizaPerfilFDelegate, new object[] {
						perfilNombre, perfilId}, this.onEndActualizaPerfilFDelegate, customActualizaPerfilFDelegate, null);
        }
    }
}